package com.ruoyi.web.controller.app.pay.wechat.entity;

import com.google.common.collect.Maps;

import java.io.Serializable;
import java.util.TreeMap;

public class PayInfo implements Serializable {
	/**
	 * @方法说明： 微信预支付实体类
	 */
	private static final long serialVersionUID = -8865589742551014685L;
	private String appid;   //公众号ID
	private String mch_id;  // 商户id
	private String device_info = "WEB"; //终端设备号(门店号或收银设备ID)，默认请传"WEB"
	private String nonce_str;  //随机字符串
	private String sign;    //签名
	private String body;   //商品名称   网页title名称-商品名 例如：  网页标题-QQ会员     
	private String attach; //附件数据
	private String out_trade_no; //订单号
	private int    total_fee;   //金额 单位分
	private String spbill_create_ip;  //用户IP
	private String notify_url;   //异步通知接口
	private String trade_type;    //交易类型
	private String openid;    //
	
	
	public PayInfo(String appid, String mch_id, String openid, String nonce_str){
        this.appid=appid;
        this.mch_id=mch_id;
        this.openid=openid;
        this.nonce_str=nonce_str;
    }
	public PayInfo(String appid, String mch_id , String nonce_str){
        this.appid=appid;
        this.mch_id=mch_id;
        this.nonce_str=nonce_str;
    }
	
	
	   /**
     *  预支付生成订单
     * @return
     */
    public TreeMap<String,String> getPrePayTreeMap(){
        TreeMap<String,String> treeMap =  Maps.newTreeMap();
        treeMap.put("appid",appid);
        treeMap.put("mch_id",mch_id);
        treeMap.put("nonce_str",nonce_str);
        treeMap.put("body",body);
        treeMap.put("out_trade_no",out_trade_no);
        treeMap.put("total_fee",total_fee+"");

        treeMap.put("spbill_create_ip",spbill_create_ip);  //APP和网页支付提交用户端ip
        treeMap.put("trade_type",trade_type);
        treeMap.put("notify_url",notify_url);
        treeMap.put("attach",attach);
     


        return treeMap;
    }
	

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getMch_id() {
		return mch_id;
	}

	public void setMch_id(String mch_id) {
		this.mch_id = mch_id;
	}

	public String getDevice_info() {
		return device_info;
	}

	public void setDevice_info(String device_info) {
		this.device_info = device_info;
	}

	public String getNonce_str() {
		return nonce_str;
	}

	public void setNonce_str(String nonce_str) {
		this.nonce_str = nonce_str;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public String getAttach() {
		return attach;
	}

	public void setAttach(String attach) {
		this.attach = attach;
	}

	public String getOut_trade_no() {
		return out_trade_no;
	}

	public void setOut_trade_no(String out_trade_no) {
		this.out_trade_no = out_trade_no;
	}

	public int getTotal_fee() {
		return total_fee;
	}

	public void setTotal_fee(int total_fee) {
		this.total_fee = total_fee;
	}

	public String getSpbill_create_ip() {
		return spbill_create_ip;
	}

	public void setSpbill_create_ip(String spbill_create_ip) {
		this.spbill_create_ip = spbill_create_ip;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getTrade_type() {
		return trade_type;
	}

	public void setTrade_type(String trade_type) {
		this.trade_type = trade_type;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

}
